<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="description" content="刘清政">
  <meta name="keyword" content="hexo-theme">
  
    <link rel="shortcut icon" href="/css/images/logo.png">
  
  <title>
    
      python/Django-rest-framework框架/10-drf-Xadmin的使用 | Justin-刘清政的博客
    
  </title>
  <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
  <link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/tomorrow.min.css" rel="stylesheet">
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/css/plugins/gitment.css">

  
  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/geopattern/1.2.3/js/geopattern.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
  
    
<script src="/js/qrious.js"></script>

  
  
    
<script src="/js/gitment.js"></script>

  
  

  
<meta name="generator" content="Hexo 4.2.0"></head>
<div class="wechat-share">
  <img src="/css/images/logo.png" />
</div>

  <body>
    <header class="header fixed-header">
  <div class="header-container">
    <a class="home-link" href="/">
      <div class="logo"></div>
      <span>Justin-刘清政的博客</span>
    </a>
    <ul class="right-list">
      
        <li class="list-item">
          
            <a href="/" class="item-link">主页</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/tags/" class="item-link">标签</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/archives/" class="item-link">归档</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/about/" class="item-link">关于我</a>
          
        </li>
      
    </ul>
    <div class="menu">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </div>
    <div class="menu-mask">
      <ul class="menu-list">
        
          <li class="menu-item">
            
              <a href="/" class="menu-link">主页</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/tags/" class="menu-link">标签</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/archives/" class="menu-link">归档</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/about/" class="menu-link">关于我</a>
            
          </li>
        
      </ul>
    </div>
  </div>
</header>

    <div id="article-banner">
  <h2>python/Django-rest-framework框架/10-drf-Xadmin的使用</h2>



  <p class="post-date">2020-06-28</p>
    <!-- 不蒜子统计 -->
    <span id="busuanzi_container_page_pv" style='display:none' class="">
        <i class="icon-smile icon"></i> 阅读数：<span id="busuanzi_value_page_pv"></span>次
    </span>
  <div class="arrow-down">
    <a href="javascript:;"></a>
  </div>
</div>
<main class="app-body flex-box">
  <!-- Article START -->
  <article class="post-article">
    <section class="markdown-content"><h1 id="一-Xadmin的使用"><a href="#一-Xadmin的使用" class="headerlink" title="一 Xadmin的使用"></a>一 Xadmin的使用</h1><p>xadmin是Django的第三方扩展，可是使Django的admin站点使用更方便。</p>
<p>文档：<a href="https://xadmin.readthedocs.io/en/latest/index.html" target="_blank" rel="noopener">https://xadmin.readthedocs.io/en/latest/index.html</a></p>
<h2 id="1-1-安装"><a href="#1-1-安装" class="headerlink" title="1.1 安装"></a>1.1 安装</h2><p>通过如下命令安装xadmin的最新版</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install https://codeload.github.com/sshwsfc/xadmin/zip/django2</span><br></pre></td></tr></table></figure>

<p>在配置文件中注册如下应用</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))</span><br><span class="line"><span class="comment"># 把apps目录设置环境变量中的导包路径</span></span><br><span class="line">sys.path.append( os.path.join(BASE_DIR,<span class="string">"luffy/apps"</span>) )</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">INSTALLED_APPS = [</span><br><span class="line">    ...</span><br><span class="line">    <span class="string">'xadmin'</span>,</span><br><span class="line">    <span class="string">'crispy_forms'</span>,</span><br><span class="line">    <span class="string">'reversion'</span>,</span><br><span class="line">    ...</span><br><span class="line">]</span><br><span class="line"></span><br><span class="line"><span class="comment"># 修改使用中文界面</span></span><br><span class="line">LANGUAGE_CODE = <span class="string">'zh-Hans'</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 修改时区</span></span><br><span class="line">TIME_ZONE = <span class="string">'Asia/Shanghai'</span></span><br></pre></td></tr></table></figure>

<p>xadmin有建立自己的数据库模型类，需要进行数据库迁移</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">python manage.py makemigrations</span><br><span class="line">python manage.py migrate</span><br></pre></td></tr></table></figure>

<p>在总路由中添加xadmin的路由信息</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> xadmin</span><br><span class="line">xadmin.autodiscover()</span><br><span class="line"></span><br><span class="line"><span class="comment"># version模块自动注册需要版本控制的 Model</span></span><br><span class="line"><span class="keyword">from</span> xadmin.plugins <span class="keyword">import</span> xversion</span><br><span class="line">xversion.register_models()</span><br><span class="line"></span><br><span class="line">urlpatterns = [</span><br><span class="line">    path(<span class="string">r'xadmin/'</span>, xadmin.site.urls)</span><br><span class="line">]</span><br></pre></td></tr></table></figure>

<p>创建超级用户</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py createsuperuser</span><br></pre></td></tr></table></figure>

<h2 id="1-2-使用"><a href="#1-2-使用" class="headerlink" title="1.2 使用"></a>1.2 使用</h2><ul>
<li>xadmin不再使用Django的admin.py，而是需要编写代码在adminx.py文件中。</li>
<li>xadmin的站点管理类不用继承<code>admin.ModelAdmin</code>，而是直接继承<code>object</code>即可。</li>
</ul>
<p>例如：在子应用中创建adminx.py文件。</p>
<h3 id="1-2-1-站点的全局配置"><a href="#1-2-1-站点的全局配置" class="headerlink" title="1.2.1 站点的全局配置"></a>1.2.1 站点的全局配置</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> xadmin</span><br><span class="line"><span class="keyword">from</span> xadmin <span class="keyword">import</span> views</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">BaseSetting</span><span class="params">(object)</span>:</span></span><br><span class="line">    <span class="string">"""xadmin的基本配置"""</span></span><br><span class="line">    enable_themes = <span class="literal">True</span>  <span class="comment"># 开启主题切换功能</span></span><br><span class="line">    use_bootswatch = <span class="literal">True</span></span><br><span class="line"></span><br><span class="line">xadmin.site.register(views.BaseAdminView, BaseSetting)</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">GlobalSettings</span><span class="params">(object)</span>:</span></span><br><span class="line">    <span class="string">"""xadmin的全局配置"""</span></span><br><span class="line">    site_title = <span class="string">"路飞学城"</span>  <span class="comment"># 设置站点标题</span></span><br><span class="line">    site_footer = <span class="string">"路飞学城有限公司"</span>  <span class="comment"># 设置站点的页脚</span></span><br><span class="line">    menu_style = <span class="string">"accordion"</span>  <span class="comment"># 设置菜单折叠</span></span><br><span class="line"></span><br><span class="line">xadmin.site.register(views.CommAdminView, GlobalSettings)</span><br></pre></td></tr></table></figure>

<h3 id="1-2-2-站点Model管理"><a href="#1-2-2-站点Model管理" class="headerlink" title="1.2.2 站点Model管理"></a>1.2.2 站点Model管理</h3><p>xadmin可以使用的页面样式控制基本与Django原生的admin一直。</p>
<ul>
<li><p><strong>list_display</strong> 控制列表展示的字段</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">list_display &#x3D; [&#39;id&#39;, &#39;btitle&#39;, &#39;bread&#39;, &#39;bcomment&#39;]</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>search_fields</strong> 控制可以通过搜索框搜索的字段名称，xadmin使用的是模糊查询</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">search_fields &#x3D; [&#39;id&#39;,&#39;btitle&#39;]</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>list_filter</strong> 可以进行过滤操作的列，对于分类、性别、状态</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">list_filter &#x3D; [&#39;is_delete&#39;]</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>ordering</strong> 默认排序的字段</p>
</li>
<li><p><strong>readonly_fields</strong> 在编辑页面的只读字段</p>
</li>
<li><p><strong>exclude</strong> 在编辑页面隐藏的字段</p>
</li>
<li><p><strong>list_editable</strong> 在列表页可以快速直接编辑的字段</p>
</li>
<li><p><strong>show_detail_fields</strong> 在列表页提供快速显示详情信息</p>
</li>
<li><p><strong>refresh_times</strong> 指定列表页的定时刷新</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">refresh_times &#x3D; [5, 10,30,60]  # 设置允许后端管理人员按多长时间(秒)刷新页面</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>list_export</strong> 控制列表页导出数据的可选格式</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">list_export &#x3D; (&#39;xls&#39;, &#39;xml&#39;, &#39;json&#39;)   list_export设置为None来禁用数据导出功能</span><br><span class="line">list_export_fields &#x3D; (&#39;id&#39;, &#39;btitle&#39;, &#39;bpub_date&#39;)</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>show_bookmarks</strong> 控制是否显示书签功能</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">show_bookmarks &#x3D; True</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>data_charts</strong> 控制显示图表的样式</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">data_charts = &#123;</span><br><span class="line">        <span class="string">"order_amount"</span>: &#123;</span><br><span class="line">          <span class="string">'title'</span>: <span class="string">'图书发布日期表'</span>, </span><br><span class="line">          <span class="string">"x-field"</span>: <span class="string">"bpub_date"</span>, </span><br><span class="line">          <span class="string">"y-field"</span>: (<span class="string">'btitle'</span>,),</span><br><span class="line">          <span class="string">"order"</span>: (<span class="string">'id'</span>,)</span><br><span class="line">        &#125;,</span><br><span class="line">    <span class="comment">#    支持生成多个不同的图表</span></span><br><span class="line">    <span class="comment">#    "order_amount": &#123;</span></span><br><span class="line">    <span class="comment">#      'title': '图书发布日期表', </span></span><br><span class="line">    <span class="comment">#      "x-field": "bpub_date", </span></span><br><span class="line">    <span class="comment">#      "y-field": ('btitle',),</span></span><br><span class="line">    <span class="comment">#      "order": ('id',)</span></span><br><span class="line">    <span class="comment">#    &#125;,</span></span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>title 控制图标名称</li>
<li>x-field 控制x轴字段</li>
<li>y-field 控制y轴字段，可以是多个值</li>
<li>order 控制默认排序</li>
</ul>
</li>
<li><p><strong>model_icon</strong> 控制菜单的图标</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">BookInfoAdmin</span><span class="params">(object)</span>:</span></span><br><span class="line">    model_icon = <span class="string">'fa fa-gift'</span></span><br><span class="line"></span><br><span class="line">xadmin.site.register(models.BookInfo, BookInfodmin)</span><br></pre></td></tr></table></figure></li>
</ul>
</section>
    <!-- Tags START -->
    
    <!-- Tags END -->
    <!-- NAV START -->
    
  <div class="nav-container">
    <!-- reverse left and right to put prev and next in a more logic postition -->
    
      <a class="nav-left" href="/python/Django-rest-framework%E6%A1%86%E6%9E%B6/9-drf-JWT%E8%AE%A4%E8%AF%81/">
        <span class="nav-arrow">← </span>
        
          python/Django-rest-framework框架/9-drf-JWT认证
        
      </a>
    
    
      <a class="nav-right" href="/python/Django-rest-framework%E6%A1%86%E6%9E%B6/8-drf-%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3/">
        
          python/Django-rest-framework框架/8-drf-自动生成接口文档
        
        <span class="nav-arrow"> →</span>
      </a>
    
  </div>

    <!-- NAV END -->
    <!-- 打赏 START -->
    
      <div class="money-like">
        <div class="reward-btn">
          赏
          <span class="money-code">
            <span class="alipay-code">
              <div class="code-image"></div>
              <b>使用支付宝打赏</b>
            </span>
            <span class="wechat-code">
              <div class="code-image"></div>
              <b>使用微信打赏</b>
            </span>
          </span>
        </div>
        <p class="notice">点击上方按钮,请我喝杯咖啡！</p>
      </div>
    
    <!-- 打赏 END -->
    <!-- 二维码 START -->
    
      <div class="qrcode">
        <canvas id="share-qrcode"></canvas>
        <p class="notice">扫描二维码，分享此文章</p>
      </div>
    
    <!-- 二维码 END -->
    
      <!-- Gitment START -->
      <div id="comments"></div>
      <!-- Gitment END -->
    
  </article>
  <!-- Article END -->
  <!-- Catalog START -->
  
    <aside class="catalog-container">
  <div class="toc-main">
  <!-- 不蒜子统计 -->
    <strong class="toc-title">目录</strong>
    
      <ol class="toc-nav"><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#一-Xadmin的使用"><span class="toc-nav-text">一 Xadmin的使用</span></a><ol class="toc-nav-child"><li class="toc-nav-item toc-nav-level-2"><a class="toc-nav-link" href="#1-1-安装"><span class="toc-nav-text">1.1 安装</span></a></li><li class="toc-nav-item toc-nav-level-2"><a class="toc-nav-link" href="#1-2-使用"><span class="toc-nav-text">1.2 使用</span></a><ol class="toc-nav-child"><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#1-2-1-站点的全局配置"><span class="toc-nav-text">1.2.1 站点的全局配置</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#1-2-2-站点Model管理"><span class="toc-nav-text">1.2.2 站点Model管理</span></a></li></ol></li></ol></li></ol>
    
  </div>
</aside>
  
  <!-- Catalog END -->
</main>

<script>
  (function () {
    var url = 'http://www.liuqingzheng.top/python/Django-rest-framework框架/10-drf-Xadmin的使用/';
    var banner = ''
    if (banner !== '' && banner !== 'undefined' && banner !== 'null') {
      $('#article-banner').css({
        'background-image': 'url(' + banner + ')'
      })
    } else {
      $('#article-banner').geopattern(url)
    }
    $('.header').removeClass('fixed-header')

    // error image
    $(".markdown-content img").on('error', function() {
      $(this).attr('src', 'http://file.muyutech.com/error-img.png')
      $(this).css({
        'cursor': 'default'
      })
    })

    // zoom image
    $(".markdown-content img").on('click', function() {
      var src = $(this).attr('src')
      if (src !== 'http://file.muyutech.com/error-img.png') {
        var imageW = $(this).width()
        var imageH = $(this).height()

        var zoom = ($(window).width() * 0.95 / imageW).toFixed(2)
        zoom = zoom < 1 ? 1 : zoom
        zoom = zoom > 2 ? 2 : zoom
        var transY = (($(window).height() - imageH) / 2).toFixed(2)

        $('body').append('<div class="image-view-wrap"><div class="image-view-inner"><img src="'+ src +'" /></div></div>')
        $('.image-view-wrap').addClass('wrap-active')
        $('.image-view-wrap img').css({
          'width': `${imageW}`,
          'transform': `translate3d(0, ${transY}px, 0) scale3d(${zoom}, ${zoom}, 1)`
        })
        $('html').css('overflow', 'hidden')

        $('.image-view-wrap').on('click', function() {
          $(this).remove()
          $('html').attr('style', '')
        })
      }
    })
  })();
</script>


  <script>
    var qr = new QRious({
      element: document.getElementById('share-qrcode'),
      value: document.location.href
    });
  </script>



  <script>
    var gitmentConfig = "liuqingzheng";
    if (gitmentConfig !== 'undefined') {
      var gitment = new Gitment({
        id: "python/Django-rest-framework框架/10-drf-Xadmin的使用",
        owner: "liuqingzheng",
        repo: "FuckBlog",
        oauth: {
          client_id: "32a4076431cf39d0ecea",
          client_secret: "94484bd79b3346a949acb2fda3c8a76ce16990c6"
        },
        theme: {
          render(state, instance) {
            const container = document.createElement('div')
            container.lang = "en-US"
            container.className = 'gitment-container gitment-root-container'
            container.appendChild(instance.renderHeader(state, instance))
            container.appendChild(instance.renderEditor(state, instance))
            container.appendChild(instance.renderComments(state, instance))
            container.appendChild(instance.renderFooter(state, instance))
            return container;
          }
        }
      })
      gitment.render(document.getElementById('comments'))
    }
  </script>




    <div class="scroll-top">
  <span class="arrow-icon"></span>
</div>
    <footer class="app-footer">
<!-- 不蒜子统计 -->
<span id="busuanzi_container_site_pv">
     本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>
<span class="post-meta-divider">|</span>
<span id="busuanzi_container_site_uv" style='display:none'>
     本站访客数<span id="busuanzi_value_site_uv"></span>人
</span>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>



  <p class="copyright">
    &copy; 2021 | Proudly powered by <a href="https://www.cnblogs.com/xiaoyuanqujing" target="_blank">小猿取经</a>
    <br>
    Theme by <a href="https://www.cnblogs.com/xiaoyuanqujing" target="_blank" rel="noopener">小猿取经</a>
  </p>
</footer>

<script>
  function async(u, c) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }
</script>
<script>
  async("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function(){
    FastClick.attach(document.body);
  })
</script>

<script>
  var hasLine = 'true';
  async("//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js", function(){
    $('figure pre').each(function(i, block) {
      var figure = $(this).parents('figure');
      if (hasLine === 'false') {
        figure.find('.gutter').hide();
      }
      var lang = figure.attr('class').split(' ')[1] || 'code';
      var codeHtml = $(this).html();
      var codeTag = document.createElement('code');
      codeTag.className = lang;
      codeTag.innerHTML = codeHtml;
      $(this).attr('class', '').empty().html(codeTag);
      figure.attr('data-lang', lang.toUpperCase());
      hljs.highlightBlock(block);
    });
  })
</script>





<!-- Baidu Tongji -->

<script>
    var _baId = 'c5fd96eee1193585be191f318c3fa725';
    // Originial
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?" + _baId;
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
</script>


<script src="/js/script.js"></script>


<script src="/js/search.js"></script>


<script src="/js/load.js"></script>



  <span class="local-search local-search-google local-search-plugin" style="right: 50px;top: 70px;;position:absolute;z-index:2;">
      <input type="search" placeholder="站内搜索" id="local-search-input" class="local-search-input-cls" style="">
      <div id="local-search-result" class="local-search-result-cls"></div>
  </span>


  </body>
</html>